function showPanel(obj) {
	var col = document.getElementById("ifcolor").value;
	var fot = document.getElementById("iffont").value;
	var siz = document.getElementById("ifsize").value;

	var str = '<br><table id="panel" width="100%" border="0" cellspacing="0" cellpadding="0">';
	str += '<tr>';
	str += '<td width="30%">&nbsp;字体大小</td>';
	str += '<td width="70%">';
	str += '<select onchange="cFSize(this.value)">';
	str += '<option value="3pt" ' + (siz == "3pt" ? "selected" : "")
			+ '>3</option>';
	str += '<option value="4pt" ' + (siz == "4pt" ? "selected" : "")
			+ '>4</option>';
	str += '<option value="5pt" ' + (siz == "5pt" ? "selected" : "")
			+ '>5</option>';
	str += '<option value="6pt" ' + (siz == "6pt" ? "selected" : "")
			+ '>6</option>';
	str += '<option value="7pt" ' + (siz == "7pt" ? "selected" : "")
			+ '>7</option>';
	str += '<option value="8pt" ' + (siz == "8pt" ? "selected" : "")
			+ '>8</option>';
	str += '<option value="9pt" ' + (siz == "9pt" ? "selected" : "")
			+ '>9</option>';
	str += '<option value="10pt" ' + (siz == "10pt" ? "selected" : "")
			+ '>10</option>';
	str += '<option value="11pt" ' + (siz == "11pt" ? "selected" : "")
			+ '>11</option>';
	str += '<option value="12pt" ' + (siz == "12pt" ? "selected" : "")
			+ '>12</option>';
	str += '<option value="13pt" ' + (siz == "13pt" ? "selected" : "")
			+ '>13</option>';
	str += '<option value="14pt" ' + (siz == "14pt" ? "selected" : "")
			+ '>14</option>';
	str += '<option value="15pt" ' + (siz == "15pt" ? "selected" : "")
			+ '>15</option>';
	str += '<option value="16pt" ' + (siz == "16pt" ? "selected" : "")
			+ '>16</option>';
	str += '<option value="17pt" ' + (siz == "17pt" ? "selected" : "")
			+ '>17</option>';
	str += '<option value="18pt" ' + (siz == "18pt" ? "selected" : "")
			+ '>18</option>';
	str += '<option value="19pt" ' + (siz == "19pt" ? "selected" : "")
			+ '>19</option>';
	str += '<option value="20pt" ' + (siz == "20pt" ? "selected" : "")
			+ '>20</option>';
	str += '</select>';
	str += '</td>';
	str += '</tr>';
	str += '<tr>';
	str += '<td>&nbsp;字体颜色</td>';
	str += '<td height="40" align="left">';
	str += '<table width="98%" height="98%"><tr><td ';
	if (col != "#000000") {
		str += 'style="background-Color:' + col + '"';
	}
	str += 'onclick="cFColor()">点击调用调色板</td></tr></table>';
	str += '</td>';
	str += '</tr>';
	/*
	 * str += '<tr>'; str += '<td>&nbsp;背景颜色</td>'; str += '<td height="40" align="left">';
	 * str += '<table width="98%" height="98%"><tr><td onclick="cBGColor()">点击调用调色板</td></tr></table>';
	 * str += '</td>'; str += '</tr>';
	 */
	str += '<tr>';
	str += '<td>&nbsp;字体类型</td>';
	str += '<td>';
	str += '<select onchange="cFFace(this.value)">';
	str += '<option value="宋体" ' + (fot == "宋体" ? "selected" : "")
			+ '>宋体</option>';
	str += '<option value="楷体_GB2312" '
			+ (fot == "楷体_GB2312" ? "selected" : "") + '>楷体_GB2312</option>';
	str += '<option value="仿宋_GB2312" '
			+ (fot == "仿宋_GB2312" ? "selected" : "") + '>仿宋_GB2312</option>';
	str += '<option value="黑体" ' + (fot == "黑体" ? "selected" : "")
			+ '>黑体</option>';
	str += '<option value="华文彩云" ' + (fot == "华文彩云" ? "selected" : "")
			+ '>华文彩云</option>';
	str += '<option value="华文仿宋" ' + (fot == "华文仿宋" ? "selected" : "")
			+ '>华文仿宋</option>';
	str += '<option value="Arial, Helvetica, sans-serif" '
			+ (fot == "Arial, Helvetica, sans-serif" ? "selected" : "")
			+ '>Arial, Helvetica, sans-serif</option>';
	str += '<option value="Times New Roman, Times, serif" '
			+ (fot == "Times New Roman, Times, serif" ? "selected" : "")
			+ '>Times New Roman, Times, serif</option>';
	str += '</select>';
	str += '</td>';
	str += '</tr>';
	str += '<tr>';
	str += '<td colspan="2" height="30" align="center"><input type="button" value=" 确定 " class="button0" onclick="javascript:closeDialog();">';
	str += '&nbsp;<input type="button" value=" 关闭 " class="button0" onclick="javascript:closeDialog();"></td>';
	str += '</tr>';
	str += '</table>';

	// document.getElementById("panel").innerHTML = str;

	var cp = new Ext.ColorPalette();

	cp.on('select', function(p, v) {
		document.getElementById("ifcolor").value = '#' + v;
			// Ext.getBody().setStyle('color','#'+v);//把body里面的文字变为所选中的文字
		Ext.getCmp('infotitlcolorwin').close();
		});

	var win = new Ext.Window({
				id : 'infotitlcolorwin',
				renderTo : Ext.getBody(),
				layout : 'fit',
				width : 200,
				height : 200,
				title : '选择标题文字颜色',
				resizable : false,
				plain : true,
				modal : true,

				items : new Ext.Panel({
							border : false,
							items : cp
						}),
				buttons : [{
							text : '关 闭',
							handler : function() {
								win.close();
							}
						}]
			});
	win.show(this);
}

/* 字体颜色 */
function cFColor() {
	var tempColor = "000000";
	var dlg = dlgHelper.ChooseColorDlg(tempColor);
	var Hcolor = dlg.toString(16);
	var Dcolor = dlg.toString(10);

	with (event.srcElement) {
		if (Hcolor != 0) {
			value = ((Hcolor.length < 6) ? "000000".substring(0, 6
							- Hcolor.length) : "")
					+ Hcolor;
			style.backgroundColor = ((Hcolor.length < 6) ? "000000".substring(
					0, 6 - Hcolor.length) : "")
					+ Hcolor;
			tempColor = ((Hcolor.length < 6) ? "000000".substring(0, 6
							- Hcolor.length) : "")
					+ Hcolor;
		}
	}
	if (tempColor != "") {
		document.getElementById("ifcolor").value = "#" + tempColor;
	}
	// document.getElementById("color_" + id).value = Dcolor - 16777216;
}

function cFSize(s) {
	document.getElementById("ifsize").value = s;
}

function cFFace(f) {
	document.getElementById("iffont").value = f;
}

function previewInfo(t) {
	if (isblank(document.form1.iftitle)) {
		alert("请填写标题");
	} else {
		document.form1.ifcontent.value = t;
		document.form1.action = context + "/app/info.do?method=preview";
		document.form1.target = "_blank";
		document.form1.submit();
	}
}

var allannex = 0;

function addFile() {
	var bindObject = document.createElement("div");
	bindObject.id = "filespan_" + allannex;
	var str = "<input type=\"file\" name=\"file_" + allannex
			+ "\" style=\"width:550px;\" value=\"\">&nbsp;";
	str += "<a href=\"javascript:void(-1);\" onclick=\"javascript:document.getElementById('filespan_"
			+ allannex + "').removeNode(true);\" title=\"删除附件\">删除</a>";
	bindObject.innerHTML += str;

	document.getElementById("filearea").appendChild(bindObject);

	allannex++;
}

function handleSwitch(t) {
	if (document.getElementById(t).style.display == "none") {
		document.getElementById(t).style.display = "block";
	} else {
		document.getElementById(t).style.display = "none";
	}
}